.class public Lcom/estrongs/fs/util/a;
.super Lcom/estrongs/fs/util/c;
.source "ESDecrypt.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/estrongs/fs/util/a$a;
    }
.end annotation


# static fields
.field public static final s:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Lcom/estrongs/fs/util/a$a;",
            ">;"
        }
    .end annotation
.end field


# instance fields
.field private g:I

.field private h:I

.field private i:[B

.field private j:[B

.field private k:[B

.field private l:[B

.field private m:[B

.field private n:Ljava/lang/String;

.field private o:Z

.field private p:Ljavax/crypto/Cipher;

.field private q:Ljava/io/File;

.field private r:Ljava/io/File;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .line 1
    new-instance v0, Ljava/util/concurrent/ConcurrentHashMap;

    invoke-direct {v0}, Ljava/util/concurrent/ConcurrentHashMap;-><init>()V

    sput-object v0, Lcom/estrongs/fs/util/a;->s:Ljava/util/Map;

    return-void
.end method

.method public constructor <init>(Lcom/estrongs/fs/g;Ljava/lang/String;Z)V
    .locals 1

    .line 1
    invoke-direct {p0}, Lcom/estrongs/fs/util/c;-><init>()V

    const/4 v0, 0x0

    .line 2
    iput-object v0, p0, Lcom/estrongs/fs/util/a;->p:Ljavax/crypto/Cipher;

    .line 3
    iput-object p1, p0, Lcom/estrongs/fs/util/c;->b:Lcom/estrongs/fs/g;

    .line 4
    invoke-virtual {p2}, Ljava/lang/String;->getBytes()[B

    move-result-object p1

    iput-object p1, p0, Lcom/estrongs/fs/util/c;->a:[B

    .line 5
    iput-boolean p3, p0, Lcom/estrongs/fs/util/a;->o:Z

    return-void
.end method

.method private a(Ljava/io/RandomAccessFile;)V
    .locals 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/estrongs/fs/util/EncryptException;
        }
    .end annotation

    .line 130
    :try_start_0
    iget v0, p0, Lcom/estrongs/fs/util/c;->f:I

    new-array v0, v0, [B

    iput-object v0, p0, Lcom/estrongs/fs/util/a;->i:[B

    .line 131
    iget v0, p0, Lcom/estrongs/fs/util/c;->f:I

    new-array v0, v0, [B

    iput-object v0, p0, Lcom/estrongs/fs/util/a;->j:[B

    const-wide/16 v0, 0x0

    .line 132
    invoke-virtual {p1, v0, v1}, Ljava/io/RandomAccessFile;->seek(J)V

    .line 133
    iget-object v0, p0, Lcom/estrongs/fs/util/a;->i:[B

    iget v1, p0, Lcom/estrongs/fs/util/c;->f:I

    invoke-static {p1, v0, v1}, Lcom/estrongs/fs/util/c;->a(Ljava/io/RandomAccessFile;[BI)I

    iput v1, p0, Lcom/estrongs/fs/util/a;->g:I

    .line 134
    iget-wide v0, p0, Lcom/estrongs/fs/util/c;->c:J

    iget v2, p0, Lcom/estrongs/fs/util/c;->f:I

    int-to-long v2, v2

    sub-long/2addr v0, v2

    invoke-virtual {p1, v0, v1}, Ljava/io/RandomAccessFile;->seek(J)V

    .line 135
    iget-object v0, p0, Lcom/estrongs/fs/util/a;->j:[B

    iget v1, p0, Lcom/estrongs/fs/util/c;->f:I

    invoke-static {p1, v0, v1}, Lcom/estrongs/fs/util/c;->a(Ljava/io/RandomAccessFile;[BI)I

    iput v1, p0, Lcom/estrongs/fs/util/a;->h:I
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    return-void

    :catch_0
    move-exception p1

    .line 136
    new-instance v0, Lcom/estrongs/fs/util/EncryptException;

    invoke-direct {v0, p1}, Lcom/estrongs/fs/util/EncryptException;-><init>(Ljava/lang/Throwable;)V

    throw v0
.end method

.method private a(Ljava/io/RandomAccessFile;Z)V
    .locals 6
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/estrongs/fs/util/EncryptException;
        }
    .end annotation

    const-wide/16 v0, 0x0

    .line 112
    :try_start_0
    invoke-virtual {p1, v0, v1}, Ljava/io/RandomAccessFile;->seek(J)V

    .line 113
    iget-object v0, p0, Lcom/estrongs/fs/util/a;->i:[B

    iget-object v1, p0, Lcom/estrongs/fs/util/c;->a:[B

    invoke-direct {p0, v0, v1}, Lcom/estrongs/fs/util/a;->b([B[B)[B

    move-result-object v0

    iput-object v0, p0, Lcom/estrongs/fs/util/a;->l:[B

    .line 114
    array-length v0, v0

    iget-object v1, p0, Lcom/estrongs/fs/util/a;->i:[B

    array-length v1, v1
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    const-string v2, "Decrypt error!"

    if-ne v0, v1, :cond_5

    if-eqz p2, :cond_0

    .line 115
    :try_start_1
    invoke-direct {p0}, Lcom/estrongs/fs/util/a;->c()V

    .line 116
    :cond_0
    iget-object v0, p0, Lcom/estrongs/fs/util/a;->l:[B

    iget v1, p0, Lcom/estrongs/fs/util/a;->g:I

    const/4 v3, 0x0

    invoke-virtual {p1, v0, v3, v1}, Ljava/io/RandomAccessFile;->write([BII)V

    .line 117
    iget-wide v0, p0, Lcom/estrongs/fs/util/c;->c:J

    iget v4, p0, Lcom/estrongs/fs/util/c;->f:I

    int-to-long v4, v4

    sub-long/2addr v0, v4

    invoke-virtual {p1, v0, v1}, Ljava/io/RandomAccessFile;->seek(J)V

    .line 118
    iget-object v0, p0, Lcom/estrongs/fs/util/a;->j:[B

    iget-object v1, p0, Lcom/estrongs/fs/util/c;->a:[B

    invoke-direct {p0, v0, v1}, Lcom/estrongs/fs/util/a;->b([B[B)[B

    move-result-object v0

    iput-object v0, p0, Lcom/estrongs/fs/util/a;->l:[B

    .line 119
    array-length v1, v0

    iget-object v4, p0, Lcom/estrongs/fs/util/a;->j:[B

    array-length v4, v4

    if-ne v1, v4, :cond_4

    .line 120
    iget v1, p0, Lcom/estrongs/fs/util/a;->h:I

    invoke-virtual {p1, v0, v3, v1}, Ljava/io/RandomAccessFile;->write([BII)V

    if-nez p2, :cond_1

    return-void

    .line 121
    :cond_1
    invoke-virtual {p1}, Ljava/io/RandomAccessFile;->getFilePointer()J

    move-result-wide v0

    iget-wide v2, p0, Lcom/estrongs/fs/util/c;->c:J

    cmp-long p2, v0, v2

    if-nez p2, :cond_3

    .line 122
    iget-wide v0, p0, Lcom/estrongs/fs/util/c;->c:J

    invoke-virtual {p1, v0, v1}, Ljava/io/RandomAccessFile;->setLength(J)V

    .line 123
    invoke-virtual {p1}, Ljava/io/RandomAccessFile;->close()V

    .line 124
    iget-object p1, p0, Lcom/estrongs/fs/util/a;->r:Ljava/io/File;

    invoke-virtual {p1}, Ljava/io/File;->exists()Z

    move-result p1

    if-eqz p1, :cond_2

    .line 125
    iget-object p1, p0, Lcom/estrongs/fs/util/a;->r:Ljava/io/File;

    invoke-virtual {p1}, Ljava/io/File;->delete()Z

    :cond_2
    return-void

    .line 126
    :cond_3
    new-instance p1, Lcom/estrongs/fs/util/EncryptException;

    const-string p2, "Invalid RandomAccessFile operation"

    invoke-direct {p1, p2}, Lcom/estrongs/fs/util/EncryptException;-><init>(Ljava/lang/String;)V

    throw p1

    .line 127
    :cond_4
    new-instance p1, Lcom/estrongs/fs/util/EncryptException;

    invoke-direct {p1, v2}, Lcom/estrongs/fs/util/EncryptException;-><init>(Ljava/lang/String;)V

    throw p1

    .line 128
    :cond_5
    new-instance p1, Lcom/estrongs/fs/util/EncryptException;

    invoke-direct {p1, v2}, Lcom/estrongs/fs/util/EncryptException;-><init>(Ljava/lang/String;)V

    throw p1
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0

    :catch_0
    move-exception p1

    .line 129
    new-instance p2, Lcom/estrongs/fs/util/EncryptException;

    invoke-direct {p2, p1}, Lcom/estrongs/fs/util/EncryptException;-><init>(Ljava/lang/Throwable;)V

    throw p2
.end method

.method private b(Ljava/io/RandomAccessFile;)V
    .locals 6
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;,
            Lcom/estrongs/fs/util/EncryptException;
        }
    .end annotation

    const/4 v0, 0x4

    new-array v1, v0, [B

    .line 1
    invoke-virtual {p1}, Ljava/io/RandomAccessFile;->length()J

    move-result-wide v2

    const-wide/16 v4, 0x4

    sub-long/2addr v2, v4

    invoke-virtual {p1, v2, v3}, Ljava/io/RandomAccessFile;->seek(J)V

    .line 2
    invoke-static {p1, v1, v0}, Lcom/estrongs/fs/util/c;->a(Ljava/io/RandomAccessFile;[BI)I

    .line 3
    invoke-static {v0}, Ljava/nio/ByteBuffer;->allocate(I)Ljava/nio/ByteBuffer;

    invoke-static {v1}, Ljava/nio/ByteBuffer;->wrap([B)Ljava/nio/ByteBuffer;

    move-result-object v0

    invoke-virtual {v0}, Ljava/nio/ByteBuffer;->getInt()I

    move-result v0

    .line 4
    invoke-virtual {p1}, Ljava/io/RandomAccessFile;->length()J

    move-result-wide v1

    int-to-long v3, v0

    sub-long/2addr v1, v3

    iput-wide v1, p0, Lcom/estrongs/fs/util/c;->c:J

    const-wide/16 v3, 0x0

    cmp-long v5, v1, v3

    if-ltz v5, :cond_0

    .line 5
    new-array v3, v0, [B

    iput-object v3, p0, Lcom/estrongs/fs/util/a;->k:[B

    .line 6
    invoke-virtual {p1, v1, v2}, Ljava/io/RandomAccessFile;->seek(J)V

    .line 7
    iget-object v1, p0, Lcom/estrongs/fs/util/a;->k:[B

    invoke-static {p1, v1, v0}, Lcom/estrongs/fs/util/c;->a(Ljava/io/RandomAccessFile;[BI)I

    return-void

    .line 8
    :cond_0
    new-instance p1, Lcom/estrongs/fs/util/EncryptException;

    const-string v0, "Invalid filelocker file"

    invoke-direct {p1, v0}, Lcom/estrongs/fs/util/EncryptException;-><init>(Ljava/lang/String;)V

    throw p1
.end method

.method private b([B[B)[B
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/estrongs/fs/util/EncryptException;
        }
    .end annotation

    .line 9
    :try_start_0
    iget-boolean v0, p0, Lcom/estrongs/fs/util/c;->e:Z

    if-eqz v0, :cond_0

    .line 10
    invoke-static {p1, p2}, Lcom/estrongs/fs/util/c;->a([B[B)[B

    move-result-object p1

    return-object p1

    .line 11
    :cond_0
    iget-object p2, p0, Lcom/estrongs/fs/util/a;->p:Ljavax/crypto/Cipher;

    invoke-virtual {p2, p1}, Ljavax/crypto/Cipher;->doFinal([B)[B

    move-result-object p1
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    return-object p1

    :catch_0
    move-exception p1

    .line 12
    new-instance p2, Lcom/estrongs/fs/util/EncryptException;

    invoke-direct {p2, p1}, Lcom/estrongs/fs/util/EncryptException;-><init>(Ljava/lang/Throwable;)V

    throw p2
.end method

.method private c()V
    .locals 5
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/estrongs/fs/util/EncryptException;
        }
    .end annotation

    const/4 v0, 0x0

    .line 1
    :try_start_0
    new-instance v1, Ljava/io/BufferedOutputStream;

    new-instance v2, Ljava/io/FileOutputStream;

    iget-object v3, p0, Lcom/estrongs/fs/util/a;->r:Ljava/io/File;

    invoke-direct {v2, v3}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V

    invoke-direct {v1, v2}, Ljava/io/BufferedOutputStream;-><init>(Ljava/io/OutputStream;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_2
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 2
    :try_start_1
    iget-object v0, p0, Lcom/estrongs/fs/util/a;->i:[B

    iget v2, p0, Lcom/estrongs/fs/util/a;->g:I

    const/4 v3, 0x0

    invoke-virtual {v1, v0, v3, v2}, Ljava/io/OutputStream;->write([BII)V

    .line 3
    iget-object v0, p0, Lcom/estrongs/fs/util/a;->j:[B

    iget v2, p0, Lcom/estrongs/fs/util/a;->h:I

    invoke-virtual {v1, v0, v3, v2}, Ljava/io/OutputStream;->write([BII)V

    .line 4
    iget-object v0, p0, Lcom/estrongs/fs/util/a;->k:[B

    iget-object v2, p0, Lcom/estrongs/fs/util/a;->k:[B

    array-length v2, v2

    invoke-virtual {v1, v0, v3, v2}, Ljava/io/OutputStream;->write([BII)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_1

    .line 5
    :try_start_2
    invoke-virtual {v1}, Ljava/io/OutputStream;->close()V
    :try_end_2
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_0

    :catch_0
    return-void

    :catch_1
    move-exception v0

    goto :goto_0

    :catchall_0
    move-exception v1

    move-object v4, v1

    move-object v1, v0

    move-object v0, v4

    goto :goto_1

    :catch_2
    move-exception v1

    move-object v4, v1

    move-object v1, v0

    move-object v0, v4

    .line 6
    :goto_0
    :try_start_3
    new-instance v2, Lcom/estrongs/fs/util/EncryptException;

    invoke-direct {v2, v0}, Lcom/estrongs/fs/util/EncryptException;-><init>(Ljava/lang/Throwable;)V

    throw v2
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_1

    :catchall_1
    move-exception v0

    :goto_1
    if-eqz v1, :cond_0

    .line 7
    :try_start_4
    invoke-virtual {v1}, Ljava/io/OutputStream;->close()V
    :try_end_4
    .catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_3

    .line 8
    :catch_3
    :cond_0
    throw v0
.end method

.method private c(Ljava/io/RandomAccessFile;)V
    .locals 5
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const-wide/16 v0, 0x0

    .line 32
    invoke-virtual {p1, v0, v1}, Ljava/io/RandomAccessFile;->seek(J)V

    .line 33
    iget-object v0, p0, Lcom/estrongs/fs/util/a;->i:[B

    iget v1, p0, Lcom/estrongs/fs/util/a;->g:I

    const/4 v2, 0x0

    invoke-virtual {p1, v0, v2, v1}, Ljava/io/RandomAccessFile;->write([BII)V

    .line 34
    iget-wide v0, p0, Lcom/estrongs/fs/util/c;->c:J

    iget v3, p0, Lcom/estrongs/fs/util/c;->f:I

    int-to-long v3, v3

    sub-long/2addr v0, v3

    invoke-virtual {p1, v0, v1}, Ljava/io/RandomAccessFile;->seek(J)V

    .line 35
    iget-object v0, p0, Lcom/estrongs/fs/util/a;->j:[B

    iget v1, p0, Lcom/estrongs/fs/util/a;->h:I

    invoke-virtual {p1, v0, v2, v1}, Ljava/io/RandomAccessFile;->write([BII)V

    .line 36
    iget-object v0, p0, Lcom/estrongs/fs/util/a;->k:[B

    array-length v1, v0

    invoke-virtual {p1, v0, v2, v1}, Ljava/io/RandomAccessFile;->write([BII)V

    .line 37
    iget-object p1, p0, Lcom/estrongs/fs/util/a;->r:Ljava/io/File;

    invoke-virtual {p1}, Ljava/io/File;->exists()Z

    move-result p1

    if-eqz p1, :cond_0

    .line 38
    iget-object p1, p0, Lcom/estrongs/fs/util/a;->r:Ljava/io/File;

    invoke-virtual {p1}, Ljava/io/File;->delete()Z

    :cond_0
    return-void
.end method

.method private c([B)V
    .locals 6
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    .line 9
    array-length v0, p1

    const/4 v1, 0x4

    sub-int/2addr v0, v1

    const/16 v2, 0x8

    sub-int/2addr v0, v2

    const/4 v3, 0x0

    .line 10
    invoke-virtual {p0, p1, v3, v0}, Lcom/estrongs/fs/util/c;->a([BII)[B

    move-result-object v4

    new-array v5, v2, [B

    .line 11
    invoke-static {p1, v0, v5, v3, v2}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    .line 12
    invoke-static {v5, v4}, Ljava/util/Arrays;->equals([B[B)Z

    move-result v2

    if-eqz v2, :cond_6

    const/4 v2, 0x1

    sub-int/2addr v0, v2

    .line 13
    aget-byte v0, p1, v0

    and-int/lit8 v4, v0, 0x1

    if-eqz v4, :cond_0

    const/4 v4, 0x1

    goto :goto_0

    :cond_0
    const/4 v4, 0x0

    .line 14
    :goto_0
    iput-boolean v4, p0, Lcom/estrongs/fs/util/c;->e:Z

    and-int/lit8 v0, v0, 0x2

    if-eqz v0, :cond_1

    const/4 v0, 0x1

    goto :goto_1

    :cond_1
    const/4 v0, 0x0

    .line 15
    :goto_1
    iput-boolean v0, p0, Lcom/estrongs/fs/util/c;->d:Z

    .line 16
    iget-object v0, p0, Lcom/estrongs/fs/util/c;->a:[B

    invoke-direct {p0, v0}, Lcom/estrongs/fs/util/a;->d([B)V

    .line 17
    aget-byte v0, p1, v3

    const/4 v4, -0x1

    if-ltz v0, :cond_2

    .line 18
    new-array v5, v0, [B

    .line 19
    invoke-static {p1, v2, v5, v3, v0}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    .line 20
    invoke-static {v1}, Ljava/nio/ByteBuffer;->allocate(I)Ljava/nio/ByteBuffer;

    invoke-static {v5}, Ljava/nio/ByteBuffer;->wrap([B)Ljava/nio/ByteBuffer;

    move-result-object v1

    invoke-virtual {v1}, Ljava/nio/ByteBuffer;->getInt()I

    move-result v1

    iput v1, p0, Lcom/estrongs/fs/util/c;->f:I

    add-int/2addr v0, v3

    add-int/2addr v0, v2

    goto :goto_2

    .line 21
    :cond_2
    iput v4, p0, Lcom/estrongs/fs/util/c;->f:I

    const/4 v0, 0x1

    :goto_2
    add-int/lit8 v1, v0, 0x1

    .line 22
    aget-byte v5, p1, v0

    if-gez v5, :cond_3

    if-eq v5, v4, :cond_3

    and-int/lit16 v5, v5, 0xff

    :cond_3
    if-ltz v5, :cond_4

    .line 23
    new-array v4, v5, [B

    .line 24
    invoke-static {p1, v1, v4, v3, v5}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    .line 25
    iget-object v1, p0, Lcom/estrongs/fs/util/c;->a:[B

    invoke-direct {p0, v4, v1}, Lcom/estrongs/fs/util/a;->b([B[B)[B

    move-result-object v1

    .line 26
    new-instance v4, Ljava/lang/String;

    invoke-direct {v4, v1}, Ljava/lang/String;-><init>([B)V

    iput-object v4, p0, Lcom/estrongs/fs/util/a;->n:Ljava/lang/String;

    add-int/2addr v0, v5

    add-int/lit8 v1, v0, 0x1

    goto :goto_3

    :cond_4
    const/4 v0, 0x0

    .line 27
    iput-object v0, p0, Lcom/estrongs/fs/util/a;->n:Ljava/lang/String;

    :goto_3
    add-int/lit8 v0, v1, 0x1

    .line 28
    aget-byte v1, p1, v1

    if-ltz v1, :cond_5

    .line 29
    new-array v1, v1, [B

    iput-object v1, p0, Lcom/estrongs/fs/util/a;->m:[B

    .line 30
    array-length v2, v1

    invoke-static {p1, v0, v1, v3, v2}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    :cond_5
    return-void

    .line 31
    :cond_6
    new-instance p1, Lcom/estrongs/fs/util/EncryptException;

    const-string v0, "Locked file is corrupted"

    invoke-direct {p1, v0}, Lcom/estrongs/fs/util/EncryptException;-><init>(Ljava/lang/String;)V

    throw p1
.end method

.method private d([B)V
    .locals 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljavax/crypto/NoSuchPaddingException;,
            Ljava/lang/Exception;,
            Ljava/security/InvalidKeyException;,
            Ljava/security/InvalidAlgorithmParameterException;
        }
    .end annotation

    .line 1
    iget-boolean v0, p0, Lcom/estrongs/fs/util/c;->e:Z

    if-eqz v0, :cond_0

    return-void

    :cond_0
    :try_start_0
    const-string v0, "2.16.840.1.101.3.4.1.4/CFB/NoPadding"

    .line 2
    invoke-static {v0}, Ljavax/crypto/Cipher;->getInstance(Ljava/lang/String;)Ljavax/crypto/Cipher;

    move-result-object v0

    iput-object v0, p0, Lcom/estrongs/fs/util/a;->p:Ljavax/crypto/Cipher;
    :try_end_0
    .catch Ljava/security/NoSuchAlgorithmException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    :try_start_1
    const-string v0, "AES/CFB/NoPadding"

    .line 3
    invoke-static {v0}, Ljavax/crypto/Cipher;->getInstance(Ljava/lang/String;)Ljavax/crypto/Cipher;

    move-result-object v0

    iput-object v0, p0, Lcom/estrongs/fs/util/a;->p:Ljavax/crypto/Cipher;
    :try_end_1
    .catch Ljava/security/NoSuchAlgorithmException; {:try_start_1 .. :try_end_1} :catch_1

    .line 4
    :goto_0
    invoke-static {p1}, Lcom/estrongs/fs/util/c;->b([B)[B

    move-result-object p1

    const/16 v0, 0x10

    new-array v0, v0, [B

    .line 5
    fill-array-data v0, :array_0

    .line 6
    new-instance v1, Ljavax/crypto/spec/IvParameterSpec;

    invoke-direct {v1, v0}, Ljavax/crypto/spec/IvParameterSpec;-><init>([B)V

    .line 7
    new-instance v0, Ljavax/crypto/spec/SecretKeySpec;

    const-string v2, "AES"

    invoke-direct {v0, p1, v2}, Ljavax/crypto/spec/SecretKeySpec;-><init>([BLjava/lang/String;)V

    .line 8
    iget-object p1, p0, Lcom/estrongs/fs/util/a;->p:Ljavax/crypto/Cipher;

    const/4 v2, 0x2

    invoke-virtual {p1, v2, v0, v1}, Ljavax/crypto/Cipher;->init(ILjava/security/Key;Ljava/security/spec/AlgorithmParameterSpec;)V

    return-void

    :catch_1
    move-exception p1

    .line 9
    throw p1

    :array_0
    .array-data 1
        0x0t
        0x1t
        0x2t
        0x3t
        0x4t
        0x5t
        0x6t
        0x7t
        0x8t
        0x9t
        0xat
        0xbt
        0xct
        0xdt
        0xet
        0xft
    .end array-data
.end method


# virtual methods
.method public a()Z
    .locals 21
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    move-object/from16 v1, p0

    .line 1
    invoke-static {}, Les/s80;->A()Les/s80;

    move-result-object v2

    const/16 v3, 0x9

    const-wide/16 v4, 0x0

    const/4 v6, 0x2

    const/4 v7, 0x1

    const/4 v8, 0x0

    if-eqz v2, :cond_0

    new-array v0, v6, [Ljava/lang/Object;

    .line 2
    iget-wide v9, v1, Lcom/estrongs/fs/util/c;->c:J

    invoke-static {v9, v10}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v9

    aput-object v9, v0, v8

    invoke-static {v4, v5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v9

    aput-object v9, v0, v7

    invoke-virtual {v2, v3, v0}, Les/s80;->b(I[Ljava/lang/Object;)V

    .line 3
    :cond_0
    new-instance v9, Ljava/io/File;

    iget-object v0, v1, Lcom/estrongs/fs/util/c;->b:Lcom/estrongs/fs/g;

    invoke-interface {v0}, Lcom/estrongs/fs/g;->d()Ljava/lang/String;

    move-result-object v0

    invoke-direct {v9, v0}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 4
    new-instance v10, Ljava/io/RandomAccessFile;

    const-string v11, "r"

    invoke-direct {v10, v9, v11}, Ljava/io/RandomAccessFile;-><init>(Ljava/io/File;Ljava/lang/String;)V

    .line 5
    invoke-direct {v1, v10}, Lcom/estrongs/fs/util/a;->b(Ljava/io/RandomAccessFile;)V

    .line 6
    iget-object v0, v1, Lcom/estrongs/fs/util/a;->k:[B

    invoke-direct {v1, v0}, Lcom/estrongs/fs/util/a;->c([B)V

    .line 7
    iget-object v0, v1, Lcom/estrongs/fs/util/a;->m:[B

    iget-object v12, v1, Lcom/estrongs/fs/util/c;->a:[B

    invoke-static {v12}, Lcom/estrongs/fs/util/c;->a([B)[B

    move-result-object v12

    invoke-static {v0, v12}, Ljava/util/Arrays;->equals([B[B)Z

    move-result v0

    if-eqz v0, :cond_21

    .line 8
    iget-object v0, v1, Lcom/estrongs/fs/util/a;->n:Ljava/lang/String;

    if-nez v0, :cond_1

    .line 9
    invoke-virtual {v9}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v9}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v12

    const-string v13, ".eslock"

    invoke-virtual {v12, v13}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v12

    invoke-virtual {v0, v8, v12}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v0

    .line 10
    :cond_1
    new-instance v12, Ljava/io/File;

    invoke-virtual {v9}, Ljava/io/File;->getParent()Ljava/lang/String;

    move-result-object v13

    invoke-direct {v12, v13, v0}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    iput-object v12, v1, Lcom/estrongs/fs/util/a;->q:Ljava/io/File;

    .line 11
    iget-boolean v0, v1, Lcom/estrongs/fs/util/c;->d:Z

    const/4 v14, -0x1

    const/16 v15, 0x4000

    const-string v12, "rw"

    if-eqz v0, :cond_e

    .line 12
    :try_start_0
    new-instance v11, Ljava/io/RandomAccessFile;

    iget-object v0, v1, Lcom/estrongs/fs/util/a;->q:Ljava/io/File;

    invoke-direct {v11, v0, v12}, Ljava/io/RandomAccessFile;-><init>(Ljava/io/File;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_4
    .catchall {:try_start_0 .. :try_end_0} :catchall_1

    .line 13
    :try_start_1
    invoke-virtual {v10, v4, v5}, Ljava/io/RandomAccessFile;->seek(J)V

    new-array v0, v15, [B

    .line 14
    :goto_0
    invoke-virtual {v10, v0, v8, v15}, Ljava/io/RandomAccessFile;->read([BII)I

    move-result v12

    if-eq v12, v14, :cond_7

    iget-wide v13, v1, Lcom/estrongs/fs/util/c;->c:J

    cmp-long v18, v4, v13

    if-gez v18, :cond_7

    if-eqz v2, :cond_3

    .line 15
    invoke-virtual {v2}, Les/s80;->z()Z

    move-result v13

    if-eqz v13, :cond_3

    .line 16
    iget-object v0, v1, Lcom/estrongs/fs/util/a;->q:Ljava/io/File;

    if-eqz v0, :cond_2

    iget-object v0, v1, Lcom/estrongs/fs/util/a;->q:Ljava/io/File;

    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v0

    if-eqz v0, :cond_2

    .line 17
    iget-object v0, v1, Lcom/estrongs/fs/util/a;->q:Ljava/io/File;

    invoke-virtual {v0}, Ljava/io/File;->delete()Z
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_3
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 18
    :cond_2
    :try_start_2
    invoke-virtual {v11}, Ljava/io/RandomAccessFile;->close()V
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0

    goto :goto_1

    :catch_0
    move-exception v0

    move-object v2, v0

    .line 19
    invoke-virtual {v2}, Ljava/lang/Exception;->printStackTrace()V

    .line 20
    :goto_1
    :try_start_3
    invoke-virtual {v10}, Ljava/io/RandomAccessFile;->close()V
    :try_end_3
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_1

    goto :goto_2

    :catch_1
    move-exception v0

    move-object v2, v0

    .line 21
    invoke-virtual {v2}, Ljava/lang/Exception;->printStackTrace()V

    :goto_2
    return v8

    :cond_3
    int-to-long v12, v12

    add-long/2addr v4, v12

    .line 22
    :try_start_4
    iget-object v14, v1, Lcom/estrongs/fs/util/c;->a:[B

    invoke-direct {v1, v0, v14}, Lcom/estrongs/fs/util/a;->b([B[B)[B

    move-result-object v14

    iput-object v14, v1, Lcom/estrongs/fs/util/a;->l:[B

    .line 23
    array-length v3, v14

    if-ne v3, v15, :cond_6

    .line 24
    iget-wide v6, v1, Lcom/estrongs/fs/util/c;->c:J

    cmp-long v19, v4, v6

    if-gez v19, :cond_4

    .line 25
    invoke-virtual {v11, v14, v8, v15}, Ljava/io/RandomAccessFile;->write([BII)V

    goto :goto_3

    .line 26
    :cond_4
    iget-wide v6, v1, Lcom/estrongs/fs/util/c;->c:J

    sub-long v12, v4, v12

    sub-long/2addr v6, v12

    long-to-int v7, v6

    invoke-virtual {v11, v14, v8, v7}, Ljava/io/RandomAccessFile;->write([BII)V

    :goto_3
    if-eqz v2, :cond_5

    const/4 v3, 0x2

    new-array v6, v3, [Ljava/lang/Object;

    .line 27
    iget-wide v12, v1, Lcom/estrongs/fs/util/c;->c:J

    invoke-static {v12, v13}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v7

    aput-object v7, v6, v8

    invoke-static {v4, v5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v7

    const/4 v12, 0x1

    aput-object v7, v6, v12

    const/16 v7, 0x9

    invoke-virtual {v2, v7, v6}, Les/s80;->b(I[Ljava/lang/Object;)V

    :cond_5
    const/16 v3, 0x9

    const/4 v6, 0x2

    const/4 v7, 0x1

    const/4 v14, -0x1

    goto :goto_0

    .line 28
    :cond_6
    new-instance v0, Lcom/estrongs/fs/util/EncryptException;

    const-string v2, "Encrypt error!"

    invoke-direct {v0, v2}, Lcom/estrongs/fs/util/EncryptException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 29
    :cond_7
    invoke-virtual {v11}, Ljava/io/RandomAccessFile;->close()V
    :try_end_4
    .catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_3
    .catchall {:try_start_4 .. :try_end_4} :catchall_0

    .line 30
    :try_start_5
    invoke-virtual {v9}, Ljava/io/File;->delete()Z

    .line 31
    iget-boolean v0, v1, Lcom/estrongs/fs/util/a;->o:Z

    if-eqz v0, :cond_a

    .line 32
    iget-object v0, v1, Lcom/estrongs/fs/util/a;->n:Ljava/lang/String;

    if-eqz v0, :cond_8

    const/4 v0, 0x1

    goto :goto_4

    :cond_8
    const/4 v0, 0x0

    .line 33
    :goto_4
    sget-object v4, Lcom/estrongs/fs/util/a;->s:Ljava/util/Map;

    iget-object v5, v1, Lcom/estrongs/fs/util/a;->q:Ljava/io/File;

    invoke-virtual {v5}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v5

    invoke-static {v5}, Lcom/estrongs/android/util/h0;->c(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    new-instance v6, Lcom/estrongs/fs/util/a$a;

    new-instance v7, Ljava/lang/String;

    iget-object v11, v1, Lcom/estrongs/fs/util/c;->a:[B

    invoke-direct {v7, v11}, Ljava/lang/String;-><init>([B)V

    if-eqz v0, :cond_9

    invoke-virtual {v9}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v9

    goto :goto_5

    :cond_9
    const/4 v9, 0x0

    :goto_5
    invoke-direct {v6, v1, v7, v0, v9}, Lcom/estrongs/fs/util/a$a;-><init>(Lcom/estrongs/fs/util/a;Ljava/lang/String;ZLjava/lang/String;)V

    invoke-interface {v4, v5, v6}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    :cond_a
    if-eqz v2, :cond_b

    const/4 v3, 0x2

    new-array v0, v3, [Ljava/lang/Object;

    const-wide/16 v4, 0x1

    .line 34
    invoke-static {v4, v5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v4

    aput-object v4, v0, v8

    iget-object v4, v1, Lcom/estrongs/fs/util/c;->b:Lcom/estrongs/fs/g;

    invoke-interface {v4}, Lcom/estrongs/fs/g;->d()Ljava/lang/String;

    move-result-object v4

    const/4 v5, 0x1

    aput-object v4, v0, v5

    const/4 v3, 0x2

    invoke-virtual {v2, v3, v0}, Les/s80;->b(I[Ljava/lang/Object;)V
    :try_end_5
    .catch Ljava/lang/Exception; {:try_start_5 .. :try_end_5} :catch_4
    .catchall {:try_start_5 .. :try_end_5} :catchall_1

    .line 35
    :cond_b
    :try_start_6
    invoke-virtual {v10}, Ljava/io/RandomAccessFile;->close()V
    :try_end_6
    .catch Ljava/lang/Exception; {:try_start_6 .. :try_end_6} :catch_2

    :goto_6
    const/4 v2, 0x1

    goto :goto_7

    :catch_2
    move-exception v0

    move-object v2, v0

    .line 36
    invoke-virtual {v2}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_6

    :goto_7
    return v2

    :catchall_0
    move-exception v0

    move-object v2, v0

    move-object v13, v11

    goto :goto_9

    :catch_3
    move-exception v0

    move-object v13, v11

    goto :goto_8

    :catchall_1
    move-exception v0

    move-object v2, v0

    const/4 v13, 0x0

    goto :goto_9

    :catch_4
    move-exception v0

    const/4 v13, 0x0

    .line 37
    :goto_8
    :try_start_7
    iget-object v2, v1, Lcom/estrongs/fs/util/a;->q:Ljava/io/File;

    if-eqz v2, :cond_c

    iget-object v2, v1, Lcom/estrongs/fs/util/a;->q:Ljava/io/File;

    invoke-virtual {v2}, Ljava/io/File;->exists()Z

    move-result v2

    if-eqz v2, :cond_c

    .line 38
    iget-object v2, v1, Lcom/estrongs/fs/util/a;->q:Ljava/io/File;

    invoke-virtual {v2}, Ljava/io/File;->delete()Z

    .line 39
    :cond_c
    throw v0
    :try_end_7
    .catchall {:try_start_7 .. :try_end_7} :catchall_2

    :catchall_2
    move-exception v0

    move-object v2, v0

    :goto_9
    if-eqz v13, :cond_d

    .line 40
    :try_start_8
    invoke-virtual {v13}, Ljava/io/RandomAccessFile;->close()V
    :try_end_8
    .catch Ljava/lang/Exception; {:try_start_8 .. :try_end_8} :catch_5

    goto :goto_a

    :catch_5
    move-exception v0

    move-object v3, v0

    .line 41
    invoke-virtual {v3}, Ljava/lang/Exception;->printStackTrace()V

    .line 42
    :cond_d
    :goto_a
    :try_start_9
    invoke-virtual {v10}, Ljava/io/RandomAccessFile;->close()V
    :try_end_9
    .catch Ljava/lang/Exception; {:try_start_9 .. :try_end_9} :catch_6

    goto :goto_b

    :catch_6
    move-exception v0

    move-object v3, v0

    .line 43
    invoke-virtual {v3}, Ljava/lang/Exception;->printStackTrace()V

    .line 44
    :goto_b
    throw v2

    .line 45
    :cond_e
    :try_start_a
    invoke-direct {v1, v10}, Lcom/estrongs/fs/util/a;->a(Ljava/io/RandomAccessFile;)V

    .line 46
    invoke-virtual {v10}, Ljava/io/RandomAccessFile;->close()V
    :try_end_a
    .catch Ljava/lang/Exception; {:try_start_a .. :try_end_a} :catch_9

    .line 47
    :try_start_b
    iget-object v0, v1, Lcom/estrongs/fs/util/a;->q:Ljava/io/File;

    invoke-virtual {v9, v0}, Ljava/io/File;->renameTo(Ljava/io/File;)Z

    move-result v0
    :try_end_b
    .catch Ljava/lang/Exception; {:try_start_b .. :try_end_b} :catch_a

    if-nez v0, :cond_f

    return v8

    .line 48
    :cond_f
    :try_start_c
    new-instance v0, Ljava/io/RandomAccessFile;

    iget-object v6, v1, Lcom/estrongs/fs/util/a;->q:Ljava/io/File;

    invoke-direct {v0, v6, v12}, Ljava/io/RandomAccessFile;-><init>(Ljava/io/File;Ljava/lang/String;)V
    :try_end_c
    .catch Ljava/lang/Exception; {:try_start_c .. :try_end_c} :catch_8

    .line 49
    :try_start_d
    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v9}, Ljava/io/File;->getParent()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v7, "/."

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v9}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v7, ".deraw"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    .line 50
    invoke-static {v6}, Lcom/estrongs/fs/util/f;->j(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v6

    .line 51
    new-instance v7, Ljava/io/File;

    invoke-direct {v7, v6}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    iput-object v7, v1, Lcom/estrongs/fs/util/a;->r:Ljava/io/File;

    const/4 v6, 0x1

    .line 52
    invoke-direct {v1, v0, v6}, Lcom/estrongs/fs/util/a;->a(Ljava/io/RandomAccessFile;Z)V

    .line 53
    iget-boolean v0, v1, Lcom/estrongs/fs/util/a;->o:Z

    if-eqz v0, :cond_12

    .line 54
    iget-object v0, v1, Lcom/estrongs/fs/util/a;->n:Ljava/lang/String;

    if-eqz v0, :cond_10

    const/4 v0, 0x1

    goto :goto_c

    :cond_10
    const/4 v0, 0x0

    .line 55
    :goto_c
    sget-object v6, Lcom/estrongs/fs/util/a;->s:Ljava/util/Map;

    iget-object v7, v1, Lcom/estrongs/fs/util/a;->q:Ljava/io/File;

    invoke-virtual {v7}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v7

    invoke-static {v7}, Lcom/estrongs/android/util/h0;->c(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    new-instance v10, Lcom/estrongs/fs/util/a$a;

    new-instance v13, Ljava/lang/String;

    iget-object v14, v1, Lcom/estrongs/fs/util/c;->a:[B

    invoke-direct {v13, v14}, Ljava/lang/String;-><init>([B)V

    if-eqz v0, :cond_11

    invoke-virtual {v9}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v14

    goto :goto_d

    :cond_11
    const/4 v14, 0x0

    :goto_d
    invoke-direct {v10, v1, v13, v0, v14}, Lcom/estrongs/fs/util/a$a;-><init>(Lcom/estrongs/fs/util/a;Ljava/lang/String;ZLjava/lang/String;)V

    invoke-interface {v6, v7, v10}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    :cond_12
    if-eqz v2, :cond_13

    const/4 v3, 0x2

    new-array v0, v3, [Ljava/lang/Object;

    .line 56
    iget-wide v6, v1, Lcom/estrongs/fs/util/c;->c:J

    invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v6

    aput-object v6, v0, v8

    iget-wide v6, v1, Lcom/estrongs/fs/util/c;->c:J

    invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v6

    const/4 v7, 0x1

    aput-object v6, v0, v7

    const/16 v6, 0x9

    invoke-virtual {v2, v6, v0}, Les/s80;->b(I[Ljava/lang/Object;)V

    const/4 v3, 0x2

    new-array v0, v3, [Ljava/lang/Object;

    const-wide/16 v6, 0x1

    .line 57
    invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v6

    aput-object v6, v0, v8

    iget-object v6, v1, Lcom/estrongs/fs/util/c;->b:Lcom/estrongs/fs/g;

    invoke-interface {v6}, Lcom/estrongs/fs/g;->d()Ljava/lang/String;

    move-result-object v6

    const/4 v7, 0x1

    aput-object v6, v0, v7

    const/4 v3, 0x2

    invoke-virtual {v2, v3, v0}, Les/s80;->b(I[Ljava/lang/Object;)V
    :try_end_d
    .catch Ljava/lang/Exception; {:try_start_d .. :try_end_d} :catch_7

    :cond_13
    const/4 v2, 0x1

    return v2

    :catch_7
    move-exception v0

    .line 58
    :try_start_e
    iget-object v6, v1, Lcom/estrongs/fs/util/a;->q:Ljava/io/File;

    invoke-virtual {v6, v9}, Ljava/io/File;->renameTo(Ljava/io/File;)Z

    move-result v6

    if-nez v6, :cond_14

    .line 59
    new-instance v0, Ljava/io/IOException;

    new-instance v6, Ljava/lang/StringBuilder;

    const-string v7, "Invalid file access "

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v7, v1, Lcom/estrongs/fs/util/a;->q:Ljava/io/File;

    invoke-virtual {v7}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-direct {v0, v6}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 60
    :cond_14
    new-instance v6, Ljava/io/RandomAccessFile;

    invoke-direct {v6, v9, v12}, Ljava/io/RandomAccessFile;-><init>(Ljava/io/File;Ljava/lang/String;)V

    .line 61
    invoke-direct {v1, v6}, Lcom/estrongs/fs/util/a;->c(Ljava/io/RandomAccessFile;)V

    .line 62
    invoke-virtual {v6}, Ljava/io/RandomAccessFile;->close()V

    .line 63
    throw v0

    :catch_8
    move-exception v0

    .line 64
    throw v0

    :catch_9
    move-exception v0

    .line 65
    throw v0
    :try_end_e
    .catch Ljava/lang/Exception; {:try_start_e .. :try_end_e} :catch_a

    :catch_a
    move-exception v0

    .line 66
    invoke-virtual {v0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v6

    if-eqz v6, :cond_20

    const-string v7, "ftruncate failed"

    .line 67
    invoke-virtual {v6, v7}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v7

    if-eqz v7, :cond_20

    const-string v7, "Invalid argument"

    invoke-virtual {v6, v7}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v6

    if-eqz v6, :cond_20

    .line 68
    invoke-virtual {v9}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/estrongs/android/util/h0;->X1(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_15

    .line 69
    :try_start_f
    new-instance v0, Landroid/os/StatFs;

    invoke-virtual {v9}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v6

    invoke-direct {v0, v6}, Landroid/os/StatFs;-><init>(Ljava/lang/String;)V

    .line 70
    invoke-virtual {v0}, Landroid/os/StatFs;->getBlockSize()I

    move-result v6

    int-to-long v6, v6

    .line 71
    invoke-virtual {v0}, Landroid/os/StatFs;->getAvailableBlocks()I

    move-result v0

    int-to-long v13, v0

    .line 72
    invoke-virtual {v9}, Ljava/io/File;->length()J

    move-result-wide v16

    mul-long v13, v13, v6

    cmp-long v0, v16, v13

    if-lez v0, :cond_15

    if-eqz v2, :cond_15

    const/16 v0, 0xc

    .line 73
    new-instance v6, Les/u80$a;

    const-string v7, "Error"

    const/4 v3, 0x2

    new-array v10, v3, [Ljava/lang/Long;

    .line 74
    invoke-virtual {v9}, Ljava/io/File;->length()J

    move-result-wide v16

    invoke-static/range {v16 .. v17}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v16

    aput-object v16, v10, v8

    .line 75
    invoke-static {v13, v14}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v13

    const/4 v14, 0x1

    aput-object v13, v10, v14

    invoke-direct {v6, v7, v10}, Les/u80$a;-><init>(Ljava/lang/String;Ljava/lang/Object;)V

    .line 76
    invoke-virtual {v2, v0, v6}, Les/s80;->b(ILjava/lang/Object;)V
    :try_end_f
    .catch Ljava/lang/Exception; {:try_start_f .. :try_end_f} :catch_b

    return v8

    :catch_b
    move-exception v0

    .line 77
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    .line 78
    :cond_15
    new-instance v6, Ljava/io/RandomAccessFile;

    invoke-direct {v6, v9, v11}, Ljava/io/RandomAccessFile;-><init>(Ljava/io/File;Ljava/lang/String;)V

    .line 79
    :try_start_10
    new-instance v7, Ljava/io/RandomAccessFile;

    iget-object v0, v1, Lcom/estrongs/fs/util/a;->q:Ljava/io/File;

    invoke-direct {v7, v0, v12}, Ljava/io/RandomAccessFile;-><init>(Ljava/io/File;Ljava/lang/String;)V
    :try_end_10
    .catch Ljava/lang/Exception; {:try_start_10 .. :try_end_10} :catch_10
    .catchall {:try_start_10 .. :try_end_10} :catchall_4

    .line 80
    :try_start_11
    invoke-virtual {v6, v4, v5}, Ljava/io/RandomAccessFile;->seek(J)V

    new-array v0, v15, [B

    move-wide v10, v4

    .line 81
    :goto_e
    invoke-virtual {v6, v0, v8, v15}, Ljava/io/RandomAccessFile;->read([BII)I

    move-result v12

    const/4 v13, -0x1

    if-eq v12, v13, :cond_1a

    iget-wide v13, v1, Lcom/estrongs/fs/util/c;->c:J

    cmp-long v16, v10, v13

    if-gez v16, :cond_1a

    if-eqz v2, :cond_17

    .line 82
    invoke-virtual {v2}, Les/s80;->z()Z

    move-result v13

    if-eqz v13, :cond_17

    .line 83
    iget-object v0, v1, Lcom/estrongs/fs/util/a;->q:Ljava/io/File;

    if-eqz v0, :cond_16

    iget-object v0, v1, Lcom/estrongs/fs/util/a;->q:Ljava/io/File;

    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v0

    if-eqz v0, :cond_16

    .line 84
    iget-object v0, v1, Lcom/estrongs/fs/util/a;->q:Ljava/io/File;

    invoke-virtual {v0}, Ljava/io/File;->delete()Z
    :try_end_11
    .catch Ljava/lang/Exception; {:try_start_11 .. :try_end_11} :catch_f
    .catchall {:try_start_11 .. :try_end_11} :catchall_3

    .line 85
    :cond_16
    :try_start_12
    invoke-virtual {v7}, Ljava/io/RandomAccessFile;->close()V
    :try_end_12
    .catch Ljava/lang/Exception; {:try_start_12 .. :try_end_12} :catch_c

    goto :goto_f

    :catch_c
    move-exception v0

    move-object v2, v0

    .line 86
    invoke-virtual {v2}, Ljava/lang/Exception;->printStackTrace()V

    .line 87
    :goto_f
    :try_start_13
    invoke-virtual {v6}, Ljava/io/RandomAccessFile;->close()V
    :try_end_13
    .catch Ljava/lang/Exception; {:try_start_13 .. :try_end_13} :catch_d

    goto :goto_10

    :catch_d
    move-exception v0

    move-object v2, v0

    .line 88
    invoke-virtual {v2}, Ljava/lang/Exception;->printStackTrace()V

    :goto_10
    return v8

    :cond_17
    int-to-long v12, v12

    add-long/2addr v10, v12

    .line 89
    :try_start_14
    iget-wide v3, v1, Lcom/estrongs/fs/util/c;->c:J

    cmp-long v14, v10, v3

    if-gez v14, :cond_18

    .line 90
    invoke-virtual {v7, v0, v8, v15}, Ljava/io/RandomAccessFile;->write([BII)V

    goto :goto_11

    .line 91
    :cond_18
    iget-wide v3, v1, Lcom/estrongs/fs/util/c;->c:J

    sub-long v19, v10, v12

    sub-long v3, v3, v19

    long-to-int v4, v3

    invoke-virtual {v7, v0, v8, v4}, Ljava/io/RandomAccessFile;->write([BII)V

    :goto_11
    if-eqz v2, :cond_19

    const/4 v3, 0x2

    new-array v4, v3, [Ljava/lang/Object;

    move-object v5, v4

    .line 92
    iget-wide v3, v1, Lcom/estrongs/fs/util/c;->c:J

    invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v3

    aput-object v3, v5, v8

    invoke-static {v10, v11}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v3

    const/4 v4, 0x1

    aput-object v3, v5, v4

    const/16 v4, 0x9

    invoke-virtual {v2, v4, v5}, Les/s80;->b(I[Ljava/lang/Object;)V

    const/4 v3, 0x2

    new-array v5, v3, [Ljava/lang/Object;

    const-wide/16 v16, 0x0

    add-long v12, v12, v16

    .line 93
    invoke-static {v12, v13}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v12

    aput-object v12, v5, v8

    iget-object v12, v1, Lcom/estrongs/fs/util/c;->b:Lcom/estrongs/fs/g;

    invoke-interface {v12}, Lcom/estrongs/fs/g;->d()Ljava/lang/String;

    move-result-object v12

    const/4 v13, 0x1

    aput-object v12, v5, v13

    const/4 v3, 0x2

    invoke-virtual {v2, v3, v5}, Les/s80;->b(I[Ljava/lang/Object;)V

    goto :goto_12

    :cond_19
    const/4 v3, 0x2

    const/16 v4, 0x9

    const-wide/16 v16, 0x0

    :goto_12
    move-wide/from16 v4, v16

    goto/16 :goto_e

    .line 94
    :cond_1a
    invoke-direct {v1, v7, v8}, Lcom/estrongs/fs/util/a;->a(Ljava/io/RandomAccessFile;Z)V

    .line 95
    invoke-virtual {v7}, Ljava/io/RandomAccessFile;->close()V
    :try_end_14
    .catch Ljava/lang/Exception; {:try_start_14 .. :try_end_14} :catch_f
    .catchall {:try_start_14 .. :try_end_14} :catchall_3

    .line 96
    :try_start_15
    invoke-virtual {v9}, Ljava/io/File;->delete()Z

    .line 97
    iget-boolean v0, v1, Lcom/estrongs/fs/util/a;->o:Z

    if-eqz v0, :cond_1d

    .line 98
    iget-object v0, v1, Lcom/estrongs/fs/util/a;->n:Ljava/lang/String;

    if-eqz v0, :cond_1b

    const/4 v8, 0x1

    .line 99
    :cond_1b
    sget-object v0, Lcom/estrongs/fs/util/a;->s:Ljava/util/Map;

    iget-object v2, v1, Lcom/estrongs/fs/util/a;->q:Ljava/io/File;

    invoke-virtual {v2}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lcom/estrongs/android/util/h0;->c(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    new-instance v3, Lcom/estrongs/fs/util/a$a;

    new-instance v4, Ljava/lang/String;

    iget-object v5, v1, Lcom/estrongs/fs/util/c;->a:[B

    invoke-direct {v4, v5}, Ljava/lang/String;-><init>([B)V

    if-eqz v8, :cond_1c

    invoke-virtual {v9}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v5

    goto :goto_13

    :cond_1c
    const/4 v5, 0x0

    :goto_13
    invoke-direct {v3, v1, v4, v8, v5}, Lcom/estrongs/fs/util/a$a;-><init>(Lcom/estrongs/fs/util/a;Ljava/lang/String;ZLjava/lang/String;)V

    invoke-interface {v0, v2, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_15
    .catch Ljava/lang/Exception; {:try_start_15 .. :try_end_15} :catch_10
    .catchall {:try_start_15 .. :try_end_15} :catchall_4

    .line 100
    :cond_1d
    :try_start_16
    invoke-virtual {v6}, Ljava/io/RandomAccessFile;->close()V
    :try_end_16
    .catch Ljava/lang/Exception; {:try_start_16 .. :try_end_16} :catch_e

    :goto_14
    const/4 v2, 0x1

    goto :goto_15

    :catch_e
    move-exception v0

    move-object v2, v0

    .line 101
    invoke-virtual {v2}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_14

    :goto_15
    return v2

    :catchall_3
    move-exception v0

    move-object v2, v0

    move-object v13, v7

    goto :goto_17

    :catch_f
    move-exception v0

    move-object v13, v7

    goto :goto_16

    :catchall_4
    move-exception v0

    move-object v2, v0

    const/4 v13, 0x0

    goto :goto_17

    :catch_10
    move-exception v0

    const/4 v13, 0x0

    .line 102
    :goto_16
    :try_start_17
    iget-object v2, v1, Lcom/estrongs/fs/util/a;->q:Ljava/io/File;

    if-eqz v2, :cond_1e

    iget-object v2, v1, Lcom/estrongs/fs/util/a;->q:Ljava/io/File;

    invoke-virtual {v2}, Ljava/io/File;->exists()Z

    move-result v2

    if-eqz v2, :cond_1e

    .line 103
    iget-object v2, v1, Lcom/estrongs/fs/util/a;->q:Ljava/io/File;

    invoke-virtual {v2}, Ljava/io/File;->delete()Z

    .line 104
    :cond_1e
    throw v0
    :try_end_17
    .catchall {:try_start_17 .. :try_end_17} :catchall_5

    :catchall_5
    move-exception v0

    move-object v2, v0

    :goto_17
    if-eqz v13, :cond_1f

    .line 105
    :try_start_18
    invoke-virtual {v13}, Ljava/io/RandomAccessFile;->close()V
    :try_end_18
    .catch Ljava/lang/Exception; {:try_start_18 .. :try_end_18} :catch_11

    goto :goto_18

    :catch_11
    move-exception v0

    move-object v3, v0

    .line 106
    invoke-virtual {v3}, Ljava/lang/Exception;->printStackTrace()V

    .line 107
    :cond_1f
    :goto_18
    :try_start_19
    invoke-virtual {v6}, Ljava/io/RandomAccessFile;->close()V
    :try_end_19
    .catch Ljava/lang/Exception; {:try_start_19 .. :try_end_19} :catch_12

    goto :goto_19

    :catch_12
    move-exception v0

    move-object v3, v0

    .line 108
    invoke-virtual {v3}, Ljava/lang/Exception;->printStackTrace()V

    .line 109
    :goto_19
    throw v2

    .line 110
    :cond_20
    throw v0

    .line 111
    :cond_21
    new-instance v0, Lcom/estrongs/fs/util/EncryptException;

    const-string v2, "Password is incorrect"

    invoke-direct {v0, v2}, Lcom/estrongs/fs/util/EncryptException;-><init>(Ljava/lang/String;)V

    goto :goto_1b

    :goto_1a
    throw v0

    :goto_1b
    goto :goto_1a
.end method

.method public b()Ljava/lang/String;
    .locals 1

    .line 13
    iget-object v0, p0, Lcom/estrongs/fs/util/a;->q:Ljava/io/File;

    if-nez v0, :cond_0

    const/4 v0, 0x0

    return-object v0

    .line 14
    :cond_0
    invoke-virtual {v0}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method
